<template>
  <el-tooltip :content="tooltipText"
              placement="top"
              :open-delay="1000">
    <div :class="['b-switch-message',`b-switch-message--${layout}`]">
      <span class="b-switch-message-name">{{name}}</span>
      <el-switch :value="value"
                 v-on="$listeners"
                 :disabled="disabled"
                 active-color="#17B3A3"
                 inactive-color="#BFBFBF">
      </el-switch>
    </div>
  </el-tooltip>
</template>

<script>
export default {
  name: 'BSwitchMessage',
  props: {
    tooltipText: String,
    name: String,
    value: Boolean,
    disabled: Boolean,
    layout: {
      type: String,
      default: 'vertical'
    }
  },

}
</script>

<style lang="scss" scoped>
.b-switch-message {
  display: flex;
  align-items: center;
  &--vertical {
    flex-direction: column;
  }
  &--inline {
    flex-direction: row;
  }
  &-name {
    color: #7f7f7f;
    padding-bottom: 5px;
  }
}
</style>